var appKey = '1651e58661c3fe50e5b01abaa270a9f8';


var ip = "https://zlxedu.501sh.cn/Interface/"//正式
var ip = "https://218.108.32.131:8045/Interface/"//测试
var imgIp = "https://zlxedu.501sh.cn";
var imgIp = "https://218.108.32.131:8045";
var loginInterface = ip + "pcLogin";
//var liveListInterface = ip + "getLiveList";//直播间列表
var liveListInterface = ip + "getLiveListByWeb";//直播间列表
var SMSCodeInterface = ip  + "getSMSCode";//获取验证码



 //封装过期控制代码
 function set(key,value){
    var curTime = new Date().getTime();
    console.log(curTime)
    localStorage.setItem(key,JSON.stringify({data:value,time:curTime}));
}
function get(key,exp){
    var data = localStorage.getItem(key);
    if(data && data != 'null'){
        var dataObj = JSON.parse(data);

        if (new Date().getTime() - dataObj.time>exp) {
            console.log('信息已过期');
            localStorage.setItem('userInfo','null');
            window.location.href = "./login.html";
            //alert("信息已过期")
        }else{
            var desc = localStorage.getItem('desc');
            if(desc != "操作成功"){
                return '';
            }else{
                window.location.href = './list.html';
            }
            
            // var dataObjDatatoJson = JSON.parse(dataObj.data)
            
            // return dataObjDatatoJson;
        }
    }
    
}